// components/swiperTabs.less/swiperTabs.less.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    tabs: {
      type: Array,
      value: [],
      observer: 'updateTabs',
    },
    autoplay: {
      type: Boolean,
      value: false,
    },
    interval: {
      type: Number,
      value: 5000,
    },
    duration: {
      type: Number,
      value: 1000,
    },
    circular: {
      type: Boolean,
      value: true,
    },
    current: {
      type: Number,
      value: 0,
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    current: 0
  },

/*  lifetimes: {
    attached() {
      this.setData({ current: this.data.current });
    },
  },*/

  /**
   * 组件的方法列表
   */
  methods: {
    updateTabs(tabs) {
      this.setData({ current: this.data.current });
    },
    // switchTabsClick(e) {
    //   const index = e.currentTarget.dataset.index;
    //   this.setData({ current: index });
    //   this.triggerEvent('tabChange', { index })
    // }
  }
})